package org.laowenchao.dao;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import org.laowenchao.pojo.CellTowerInfo;
import org.laowenchao.server.PMF;

public class CellTowerInfoDao {

	public CellTowerInfo getInfo(String cellId,String LAC)
	{
		PersistenceManager pm = PMF.get().getPersistenceManager();
		try
		{
			pm.setDetachAllOnCommit(true);
			Query q = pm.newQuery(CellTowerInfo.class);
			q.setFilter("cellId==cellIdParam && LAC==LACParam");
			q.declareParameters("String cellIdParam,String LACParam");
			List l = (List) q.execute(cellId,LAC);
			if(l.size()==0)
				return null;
			return (CellTowerInfo) l.get(0);
		}
		finally
		{
			pm.close();
		}

	}
	
//	public boolean updateInfo(CellTowerInfo info)
//	{
//		boolean b = false;
//		PersistenceManager pm = PMF.get().getPersistenceManager();
//		pm.getObjectById(arg0)
//		try {
//			pm.makePersistent(o);
//			b = true;
//		}catch(Exception ex){
//			ex.printStackTrace();
//		}
//		return b;
//	}
	
}
